package com.bruce.spring.http.client.controller;

import com.bruce.spring.http.api.ProtocolApi;
import com.bruce.spring.http.client.factory.ClientFactory;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;

/**
 * Created by bruce in 2025/6/26 01:43
 */
@RequiredArgsConstructor
@RestController
@HttpExchange
public class ProtocolController {

    private final ClientFactory clientFactory;

    @GetExchange("/proto")
    public String protocol() {
        ProtocolApi protocolApi = clientFactory.getClient("D1", ProtocolApi.class);

        return protocolApi.protocol();
    }


}
